<!-- head -->
{include file='public/head' /}
<!-- head -->

<!-- left -->
{include file='public/left' /}
<!-- left -->

<div class="content-wrapper">
    <section class="content-header">
        <h1>
            订单列表
            <small>全部订单</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 订单管理</a></li>
            <li class="active">订单列表</li>
        </ol>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">共计{$orderList->total()}条记录 <span style="color: red">{$orderMoney}元</span></h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <form id='iform' action="{:url('Order/OrderList')}" method="post">
                                    <div class="input-group">
                                        <input type="text" name="name" value="{$name}" class="form-control" style="width: 20%;" placeholder="请输入店铺名称...">
                                        <input type="text" name="phone" value="{$phone}" class="form-control" style="width: 15%;" placeholder="请输入店铺手机号...">
                                        <input type="text" name="ord_num" value="{$ord_num}" class="form-control" style="width: 15%;" placeholder="请输入订单号...">
                                        <input type="hidden" name="id" value="{$id}">
                                        <select class="form-control select" style="width: 15%;" name="adminid">
                                            <option selected="selected" value="0">所有人员</option>
                                            {volist name='adminlist' id='adminlist'}
                                                {if condition="$adminlist['id'] eq $admin"}
                                                    <option value="{$adminlist.id}" selected>{$adminlist.admin_note}</option>
                                                    {else/}
                                                    <option value="{$adminlist.id}">{$adminlist.admin_note}</option>
                                                {/if}
                                            {/volist}
                                        </select>
                                        <select class="form-control select" style="width: 15%;" name="status">
                                            {if condition="$status eq 1"}
                                                <option value="0">全部订单</option>
                                                <option value="1" selected="selected">有效订单</option>
                                                {else/}
                                                <option selected="selected" value="0">全部订单</option>
                                                <option value="1">有效订单</option>
                                            {/if}
                                        </select>
                                        <div class="input-group date">
                                            <div class="input-group-addon">
                                                <i class="fa fa-calendar"></i>
                                            </div>
                                            <input type="text" class="form-control pull-right" name="starttime" value="{$starttime}" id="datepicker" placeholder="选择开始时间..." autocomplete="off">
                                            <div class="input-group-addon">
                                                <i class="fa fa-calendar"></i>
                                            </div>
                                            <input type="text" class="form-control pull-right" name="endtime" value="{$endtime}" id="datepicker1" placeholder="选择结束时间..." autocomplete="off">
                                        </div>
                                        
                                        <span class="input-group-btn">
                                            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                                            </button>
                                        </span>
                                    </div>
                                </form>
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>店铺名</th>
                                        <th>用户名</th>
                                        <th>订单来源</th>
                                        <th>订单号</th>
                                        <th>实付金额</th>
                                        <th>订单状态</th>
                                        <th>创建时间</th>
                                        <th>支付方式</th>
                                        <th>支付时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name='orderList' id='admin'}
                                    <tr>
                                        <td>{$admin.id}</td>
                                        <td>{$admin.store_name}</td>
                                        <td>
                                            {if condition="$admin.real_name neq ''"}{$admin.real_name}
                                            {elseif condition="$admin.custom_name neq ''"/}{$admin.custom_name}
                                            {elseif condition="$admin.custom_phone neq ''"/}{$admin.custom_phone}
                                            {/if}
                                        </td>
                                        <td>
                                            {if condition="$admin.source eq 1"}App
                                            {elseif condition="$admin.source eq 2" /}分享
                                            {elseif condition="$admin.source eq 3" /}微信小程序
                                            {/if}
                                        </td>
                                        <td>{$admin.ord_num}</td>
                                        <td>{$admin.pay_money}</td>
                                        <td>
                                            {if condition="$admin.status eq 0"}已取消
                                            {elseif condition="$admin.status eq 1"/}待支付
                                            {elseif condition="$admin.status eq 2"/}待预约
                                            {elseif condition="$admin.status eq 3"/}已预约
                                            {elseif condition="$admin.status eq 4"/}待服务
                                            {elseif condition="$admin.status eq 5"/}已拒绝
                                            {elseif condition="$admin.status eq 6"/}员工确认开始服务
                                            {elseif condition="$admin.status eq 7"/}服务中
                                            {elseif condition="$admin.status eq 8"/}待评论
                                            {elseif condition="$admin.status eq 9"/}待回复
                                            {elseif condition="$admin.status eq 10"/}已结束
                                            {elseif condition="$admin.status eq 11"/}美容师完成服务
                                            {/if}
                                        </td>
                                        <td>{$admin.add_time|date='Y-m-d H:i',###}</td>
                                        <td>
                                            {if condition="$admin.ordtype eq 1"}现金
                                            {elseif condition="$admin.ordtype eq 2"/}VIP卡支付
                                            {elseif condition="$admin.ordtype eq 3"/}支付宝
                                            {elseif condition="$admin.ordtype eq 4"/}微信
                                            {elseif condition="$admin.ordtype eq 5"/}网页微信
                                            {elseif condition="$admin.ordtype eq 6"/}网页支付宝
                                            {elseif condition="$admin.ordtype eq 7"/}小程序
                                            {else/}<span style="color: red">未支付</span>
                                            {/if}
                                        </td>
                                        <td>{$admin.pay_time|date='Y-m-d H:i',###}</td>
                                        <td style="width: 100px; text-align:right;">
                                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('admin/Order/OrderDetails',['id'=>$admin.id],'')}" onclick="OrderDetails(this)">查看详情</button>&nbsp;
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="box-footer clearfix" style="text-align: center">
                        {$orderList->render()}
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- Select2 -->
<script src="__STATIC__/AdminLTE/plugins/select2/select2.full.min.js"></script>

<script>
    $(function () {
        //Date picker
        $('#datepicker').datepicker({
            language:  'zh-CN',  
            autoclose: true,
        });
        $('#datepicker1').datepicker({
            language:  'zh-CN',  
            autoclose: true
        });
    });
</script>
<script type="text/javascript">
    function OrderDetails(obj) {
        var url = $(obj).data('url');
        window.location.href = url;
    }
</script>
<!-- foot -->
{include file='public/foot' /}
<!-- foot -->